// pages/recharge/index.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    cash:""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  //获取账户余额
  getUserCash:function(){
    var that = this
    wx.request({
      url: app.globalData.host + '/api/UserCash/GetUserCash?uid=' + app.globalData.userInfo.Uid,
      success: function(res) {
       if(res.data.Code == 0){
         that.setData({
           cash: res.data.Data.Cash
         })
       }
      }
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getUserCash()
  }
})